import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'device_virtual_control_platform_interface.dart';

/// An implementation of [DeviceVirtualControlPlatform] that uses method channels.
class MethodChannelDeviceVirtualControl extends DeviceVirtualControlPlatform {
  /// The method channel used to interact with the native platform.
  @visibleForTesting
  final methodChannel = const MethodChannel('device_virtual_control');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  Future<bool> navigateToSystemHome() async {
    final success = await methodChannel.invokeMethod<bool>('navigateToSystemHome');
    return success ?? false;
  }
}
